package org.codegallery.dynawebappgal.service.impl;

import java.util.List;

import org.codegallery.dynawebappgal.entity.Account;
import org.codegallery.dynawebappgal.entity.Customer;
import org.codegallery.dynawebappgal.service.AccountService;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;

public class AccountServiceHbImpl extends GenericServiceImpl<Account,Long> implements AccountService {
	

	
//	public Account save(Account account) {
//		Session session=sessionFactory.getCurrentSession();
//		if (account.getId() == null) {
//			session.persist(account);
//			return account;
//		} else {
//			return (Account) session.merge(account);
//		}
//	}
//	
//	public void insertFoo(Account foo) {
//	    throw new UnsupportedOperationException();
//	}
//
//
//	public List<Account> findByCustomer(Customer customer) {
//		Session session=sessionFactory.getCurrentSession();
//		Criteria criteria=session.createCriteria(Account.class);
//		criteria.add(Restrictions.eq("customer", customer));
//		return criteria.list();
//	}

}
